home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / desktop / vizeon / setup.exe / AppDir\Vizeon Office\clock2.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2003-07-06  |  1.9 KB  |  87 lines

  1. now = new Date();
  2. day = now.getDate();
  3. if(length(day) < 2)
  4. {
  5.    clock.theDate.d1.gotoAndStop(1);
  6.    clock.theDate.d2.gotoAndStop(day + 1);
  7. }
  8. else
  9. {
  10.    clock.theDate.d1.gotoAndStop(int(day.substr(1,1)) + 1);
  11.    clock.theDate.d2.gotoAndStop(int(day.substr(2,1)) + 1);
  12. }
  13. month = now.getMonth();
  14. if(length(month) < 2)
  15. {
  16.    clock.theDate.mo1.gotoAndStop(1);
  17.    clock.theDate.mo2.gotoAndStop(month + 2);
  18. }
  19. else
  20. {
  21.    clock.theDate.mo1.gotoAndStop(int(month.substr(1,1)) + 2);
  22.    clock.theDate.mo2.gotoAndStop(int(month.substr(2,1)) + 2);
  23. }
  24. year = now.getYear() - 100;
  25. if(length(year) < 2)
  26. {
  27.    clock.theDate.y1.gotoAndStop(1);
  28.    clock.theDate.y2.gotoAndStop(year + 1);
  29. }
  30. else
  31. {
  32.    clock.theDate.y1.gotoAndStop(int(year.substr(1,1)) + 1);
  33.    clock.theDate.y2.gotoAndStop(int(year.substr(2,1)) + 1);
  34. }
  35. hour = now.getHours();
  36. if(hour < 12)
  37. {
  38.    clock.am.gotoAndStop(2);
  39.    clock.pm.gotoAndStop(1);
  40. }
  41. else
  42. {
  43.    clock.am.gotoAndStop(1);
  44.    clock.pm.gotoAndStop(2);
  45. }
  46. if(12 < hour)
  47. {
  48.    hour -= 12;
  49. }
  50. if(length(hour) < 2)
  51. {
  52.    clock.theTime.h1.gotoAndStop(1);
  53.    clock.theTime.h2.gotoAndStop(hour + 1);
  54. }
  55. else
  56. {
  57.    clock.theTime.h1.gotoAndStop(int(hour.substr(1,1)) + 1);
  58.    clock.theTime.h2.gotoAndStop(int(hour.substr(2,1)) + 1);
  59. }
  60. minutes = now.getMinutes();
  61. if(length(minutes) < 2)
  62. {
  63.    clock.theTime.mi1.gotoAndStop(1);
  64.    clock.theTime.mi2.gotoAndStop(minutes + 1);
  65. }
  66. else
  67. {
  68.    clock.theTime.mi1.gotoAndStop(int(minutes.substr(1,1)) + 1);
  69.    clock.theTime.mi2.gotoAndStop(int(minutes.substr(2,1)) + 1);
  70. }
  71. seconds = now.getSeconds();
  72. if(seconds == 0)
  73. {
  74.    clock.theTime.s1.gotoAndStop(1);
  75.    clock.theTime.s2.gotoAndStop(1);
  76. }
  77. else if(length(seconds) < 2)
  78. {
  79.    clock.theTime.s1.gotoAndStop(1);
  80.    clock.theTime.s2.gotoAndStop(seconds + 1);
  81. }
  82. else
  83. {
  84.    clock.theTime.s1.gotoAndStop(int(seconds.substr(1,1)) + 1);
  85.    clock.theTime.s2.gotoAndStop(int(seconds.substr(2,1)) + 1);
  86. }
  87.